package com.service;

import java.util.HashMap;
import java.util.Set;

public class ManageServerConnectClientThread {
    private static HashMap<String, ServerConnectClientThread> hm = new HashMap<>();

    public static void addServerConnectClientThread(String userId, ServerConnectClientThread serverConnectClientThread) {
        hm.put(userId, serverConnectClientThread);
    }

    public static ServerConnectClientThread getServerConnectClientThread(String userId) {
        return hm.get(userId);
    }

    public static String getOnlineFriendList() {
        String list = "";
        Set<String> strings = hm.keySet();
        for (String s : strings) {
            list += s + " ";
        }
        return list;
    }

    public static HashMap<String, ServerConnectClientThread> getHm() {
        return hm;
    }
}
